<template>
  <div>
    <h1 v-bgred >{{ price | pricement(2) }}</h1>
    <div v-bold>我是div组件</div>
    <button @click="look">点击获取this</button>
    <div v-colorred>我是测试插件的div</div>
    <Header/>
    <div>{{price|pricethree(3)}}</div>
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      person: {
        name: "laowang",
        age: 18,
        sex: "nan",
      },
      price: 100,
    };
  },
  filters: {
    pricement(price, num) {
      return "¥" + price.toFixed(num);
    },
  },
  directives:{
    bgred(ele){
      ele.style.background='red',
      ele.style.color='green'
    }
  },
  methods:{
    look(){
      console.log(this.a);
    }
  }
};
</script>

<style>
</style>